package com.sy.live.util;

import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.XMLConfiguration;
import org.apache.log4j.Logger;

/**
 * XML读取功能类
 */
public class XMLConfigUtil
{
	private static final Logger logger = Logger.getLogger(XMLConfigUtil.class);

	private static XMLConfiguration sysConfig = null;

	static
	{
		try
		{
			sysConfig = new XMLConfiguration("sysconfig/sysconfig.xml");
		} catch (ConfigurationException e)
		{
			// TODO Auto-generated catch block
			logger.info(e.getMessage(), e);
			e.printStackTrace();
		}
	}

	/**
	 * 返回sysConfig.xml配置文件中的节点信息
	 * 
	 * @param property
	 *            节点名称
	 * @return 返回节点内容
	 */
	public static String getSysProperty(String property)
	{
		return sysConfig.getString(property);
	}
}
